package app.android.com.wuandroidapp.test.view.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import app.android.com.wuandroidapp.R;
import app.android.com.wuandroidapp.library.fragment.BaseFragment;
import app.android.com.wuandroidapp.test.contract.HomePageContract;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * A simple {@link Fragment} subclass.
 * Activities that contain this fragment must implement the
 * {@link OnFragmentInteractionListener} interface
 * to handle interaction events.
 * Use the {@link GameFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class GameFragment extends BaseFragment {


    private static String usnames;
    @BindView(R.id.tv_textview)
    TextView tvTextview;
    Unbinder unbinder;

    public GameFragment() {
        // Required empty public constructor
    }

    public static GameFragment newInstance(String username) {
        usnames = username;
        return new GameFragment();
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View rootView = inflater.inflate(R.layout.fragment_home_page, container, false);
        unbinder = ButterKnife.bind(this, rootView);
        return rootView;
    }




    @Override
    public void onResume() {
        super.onResume();
        tvTextview.setText(usnames);
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }


}
